2. Getting Started



This chapter helps you get started using the CodeWarrior IDE (Integrated Development Environment). You can find information about system requirements, installing IDE software, and an introduction to the IDE's user interface and capabilities.

The sections in this chapter are:


NOTE

This manual describes how to use the cross-platform features of the IDE. However, you should read additional CodeWarrior documentation to learn how to develop software for a particular platform target. For information on developing software for specific platform targets, see "Targeting Documentation" on page 27.

TIP

For a quick look at the IDE's features, see "An Introduction to the CodeWarrior IDE" on page 35. The tour gives you your first glimpse of the CodeWarrior IDE.

System Requirements

The system requirements to operate the CodeWarrior IDE are specified by platform. These platforms include:


Windows

The Windows-hosted version of the CodeWarrior IDE requires the following:


Mac OS

The Mac OS-hosted version of the CodeWarrior IDE requires the following:


NOTE

When running on 68k machines, rapid application development (RAD) is not supported, and CFM 68K Enabler 4.0 is required (provided by the CodeWarrior installer).

Solaris

The Solaris-hosted version of the CodeWarrior IDE requires the following:


Linux

The Linux-hosted version of the CodeWarrior IDE requires the following:


CodeWarrior IDE Installation

To learn how to install the CodeWarrior IDE, read the QuickStart guide. The CodeWarrior installation software places the CodeWarrior IDE, compilers, linkers, tools, and debugger on your hard disk.


Programming Concepts

If you are new to programming computers, read this section to learn about the terms used in this manual.

There are three important tasks involved in developing software:

First, you create files that contain statements using a computer language such as C, C++, Java, Pascal, or assembly language. You can also create files that contain resources, which are descriptions of user interface objects such as windows, dialog boxes, and menus.

Next, you apply tools to help turn your "source" materials into an output file that executes on your target computer. These tools include compilers, linkers, other tools, and maybe even assembly-language assemblers. You use these tools to create many different types of software, depending on the tools used and the target computer. Some of the types of software you can create include applications (executables), dynamic (shared) libraries, and static libraries.

After you create a piece of software, you can use a debugger to examine that software. The debugger helps you determine whether the software executes as you intended. If the software does not run properly, you make changes to your source material so that the software behaves correctly. You continue to revise and debug the source material until the software works appropriately.


Creating Input Files

The types of files you create and use to make a program are source code files, resource files, interface or header files, library files, and project files.


Source code file

A source code file is a text file containing program statements written in a language such as C, C++, Java, Pascal, or assembly language.


Resource file

A resource file contains descriptions of user interface items, such as window definitions, dialog box layouts, and text strings. A resource file may be a binary file linked into your software product, or it may be a text file translated by a special resource compiler before being linked. Placing resources in separate files makes it convenient to tweak and customize those resources without having to recompile other parts of a program.


Interface or header file

An interface file, also called a header or include file, is a text file referred to by source code files. Typically, interface files give access to objects, variables, data structures, routines, and other items in libraries or source code files.


Library file

A library file contains objects, variables, routines, and other items that have already been compiled. There are two kinds of libraries: static and dynamic.

The IDE builds a static library right into a program. A static library cannot change (hence the term "static") unless you rebuild the program. Furthermore, you cannot share static libraries with other programs.

Although a program might refer to a dynamic library, the IDE does not build it into a program. Instead, the program hooks up with the library dynamically, that is, while the program is actually running. Often, more than one program shares the same dynamic library. Also, a dynamic library can be replaced with a newer library without affecting the programs that refer to it, as long as the newer library provides the same operations as its predecessor.


NOTE

Most platform targets support static libraries, but not all platform targets support dynamic libraries. For information on creating and using libraries for a specific platform target, see "Targeting Documentation" on page 27.

Project file

A project file contains one or more build targets. Each build target contains a list of source code files, resources, interfaces, library files, and even other project files. Each build target also contains its own settings that tell the IDE how to create your software. For more information about these build targets, see "Projects and Targets" on page 35.


Generating the Software

The types of tools the IDE uses to build your software include compilers, assemblers, and linkers. Using information from files and settings in a project's build target, the IDE automatically chooses the appropriate tools to create your software.


Compilers

A compiler translates a source code file, such as a C, C++, Pascal, or Java file, into binary machine code (also called object code) that will be used by linkers in a later build stage. A compiler is one of the first tools that the IDE invokes to build your program.


Assemblers

An assembler translates an assembly language source code file into object code. An assembler is really just a compiler, only it translates assembly language source code rather than high-level language source code like C, C++, or Pascal.


Linkers

A linker combines the object code in your project's build target with the object code produced by the compilers and assemblers in order to produce a piece of software.


Output file

The output file is the piece of software that the linker generates. There are many different types of software, such as applications and libraries. For in-depth information about the kinds of software you can develop for a platform target, see the CodeWarrior targeting documentation appropriate for your platform target. For information on which Targeting manual to read, see "Targeting Documentation" on page 27.


Debugging and Refining

A debugger is a piece of software that facilitates controlled program execution and enables you to find errors in your code. With it, you can stop at points in your program's execution and see variable contents. You can also execute one line of code at a time.

All you need to do to enable the debugger is produce special data that the debugger uses to control your program. The IDE creates debugging information or symbolics files, which contain the information the debugger needs to display and control statements, variables, objects, and data types in your source code.

The IDE includes a debugger as part of the programming environment. In addition, the IDE supports third-party debuggers on some platforms. See the CodeWarrior targeting documentation associated with your platform target for additional information.

For information on using the CodeWarrior debugger, see "Debugging Source Code" on page 389.


An Introduction to the CodeWarrior IDE

This section describes the concepts, tasks, and operation of the CodeWarrior IDE. The topics in this section are:

For information on the terms used in this section, see "About the CodeWarrior IDE" on page 17 and "Programming Concepts" on page 31.


Projects and Targets

The IDE uses projects and build targets to organize the files and settings used to create a program. A project is a file that contains one or more build targets. A build target is a collection of source code files, resource files, libraries, settings, even other projects, that describe how to create a piece of software for a particular processor or operating system. Build targets within a project may share the same files, but each build target has its own settings.

The CodeWarrior IDE also has pre-configured stationery projects. Creating a new project is as easy as deciding on a platform target and a programming language and then choosing the corresponding stationery project.

You can set options to choose the platform target for which you are developing code, customize compiler optimizations and other object code details, configure source code translation, and specify the kinds of files that may be added to a build target. Depending on the platform target, you can set additional options.

For more information on working with projects and build targets, see "Targeting Documentation" on page 27, "Working with Projects" on page 41, and "Configuring Target Options" on page 315.


Source Code Editing and Browsing

The IDE has a powerful and flexible text editor for editing source code and text files. Besides regular text-editing features, the IDE also provides drag-and-drop editing, text file manipulation in various file formats, and marker navigation in a text file.

The editor also has many practical features for programmers. Advanced programming aids include auto-indenting, syntax highlighting, routine and interface pop-up menus, and automatic balancing for braces, brackets, and parentheses. The editor works closely with the class browser to make editing, viewing, and navigating among routines, data structures, variables, and objects intuitive and quick.

The Find dialog box and the Search Menu have commands and features to search and replace text in one file or in a group of files. You can search and replace normal text or regular expressions.

A file comparison and merging command displays two text files side-by-side and lets you easily compare differences between the two files. In addition, you can compare the contents of two folders to look for differences between files.

For more information on working with text and source code files, see "Working with Files" on page 107, "Editing Source Code" on page 133, "Searching and Replacing Text" on page 165, and "Browsing Source Code" on page 205.


Compiling and Linking

The IDE has commands to preprocess, precompile, compile, update, link, run, disassemble, and check syntax. The IDE automatically chooses the appropriate compilers and linkers and automatically determines which files to operate on when you issue a compile or link command. The IDE uses the settings in a project's build targets to instruct its compilers and linkers how to process files and data. All you have to do is use one of the commands in the Project Menu.

For more information on setting options, compiling, linking, and other software generation operations, see "Configuring Target Options" on page 315 and "Compiling and Linking" on page 355.


Project Debugging

The CodeWarrior debugger provides a seamless interaction between the programming and debugging of your source code. The debugger fully supports x86, PowerPC, 68K, and Java debugging.

After you enable the debugger, you simply Run the project to use debugging features. You can pause the program at any time to set breakpoints and watchpoints, view variables or memory, step into or out of routines, and perform many other debugging tasks.


NOTE

Some versions of the CodeWarrior IDE do not ship with a debugger. In those cases, an external debugging application or other third-party debugger provides debugging support. For additional information, see the CodeWarrior targeting documentation for your particular platform.

Rapid Application Development

CodeWarrior includes rapid application development (RAD) tools for helping you quickly create new applications. You can use the RAD tools to generate a graphical user interface and associate actions with that interface. CodeWarrior manages the software framework and generates basic source code automatically. In addition, you can revise the generated source code or write your own source code to handle tasks more efficiently.

For more information about CodeWarrior's RAD tools, see "RAD Designs and Layouts" on page 493.


Version Control

You can configure the IDE to work with your preferred version control system (VCS). You can log onto a file server, retrieve files, store files, and do other revision control tasks with a VCS software package that supports the CodeWarrior IDE.

For information on using the IDE with VCS software, see "VCS Pop-Up Menu" on page 139 and "Using CodeWarrior IDE with Version Control Systems" on page 581.


Scripting

The IDE supports scripting via Perl scripts, batch files (Windows), and AppleScript (Macintosh). When you script the IDE, you can automate repetitive, time-consuming, or complex tasks.

For more information on scripting the IDE, see "Perl Scripts" on page 671, and "Scripts Menu (Mac OS)" on page 637.


Customizing the IDE

The IDE has many user-configurable options. You can use the IDE's Preferences window to customize features, set the colors and fonts for viewing and editing source code, and assign keyboard shortcuts for commands. The IDE also has conveniently-placed, easily customizable toolbars that give quick access to commands and information by simply clicking a button.

For more information on customizing the IDE, see "Configuring IDE Options" on page 249.


Working with Third-Party Tools

The IDE works with other third-party text editors, debuggers, and development tools.

For information on using CodeWarrior with third-party tools, see "IDE Extras" on page 254, "Debugging a Project" on page 362, and "Using CodeWarrior IDE with Version Control Systems" on page 581,





Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: support@metrowerks.com
Copyright © 1999, Metrowerks Corp. All rights reserved.

Last updated: May 24, 1999 * Chris Magnuson * John Roseborough